﻿using System.ComponentModel;
using System.Threading.Channels;
using System.Timers;

namespace Company.Event
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello, World!");
            var demoViewModel = new DemoViewModel();
            demoViewModel.NotifyPropertyChanged += () => { Console.WriteLine("Value changed!"); };
            demoViewModel.MyProperty = 6;
            System.Timers.Timer timer = new System.Timers.Timer();
            Boy boy = new Boy();
            Girl girl = new Girl();
            timer.Interval = 1000;
            timer.Elapsed += boy.Action;
            timer.Elapsed += girl.Action;
            timer.Start();
            Console.ReadLine();
            


        }
    }
    public class Boy
    {
        internal void Action(object? sender, ElapsedEventArgs e)
        {
            Console.WriteLine("Boy jump");
        }
    }
    public class Girl
    {
        internal void Action(object? sender, ElapsedEventArgs e)
        {
            Console.WriteLine("Girl sing");
        }
    }
    public class Teacher
    {
        public int MyProperty { get; set; }
        public int MyProperty1 { get; set; }
    }
    public class DemoViewModel
    {
        private int myVar;

        public int MyProperty
        {
            get { return myVar; }
            set { myVar = value;
                NotifyPropertyChanged?.Invoke();
            }
        }
        public event Action NotifyPropertyChanged;


    }
}
